-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Extend HIR to track the source and syntax of a lifetime #139945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions and comments, but I definitely like the direction this is headed in. I'm not certain the LifetimeSource
/LifetimeSyntax
split is the optimal representation, but it's clearer than IsAnonInPath
so I won't be too pedantic about it.
☔ The latest upstream changes (presumably #139938) made this pull request unmergeable. Please resolve the merge conflicts. |
Adding the panic on the empty case and a couple more comments should be enough for this to merge, thanks. |
7fb39fd
to
88b8053
Compare
Alright, I rebased to address the merge conflict and took a stab at the requested changes. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. A couple more nitpicks about comments because I like them to be really clear on types like these. r=me once they are done, thanks.
@bors delegate=shepmaster
@bors delegate=shepmaster |
✌️ @shepmaster, you can now approve this pull request! If @nnethercote told you to " |
88b8053
to
6c05ee2
Compare
I'm going to be optimistic that I got the comments close to the desired end state... @bors r=@nnethercote rollup |
☔ The latest upstream changes (presumably #140180) made this pull request unmergeable. Please resolve the merge conflicts. |
An upcoming lint will want to be able to know if a lifetime is hidden (e.g. `&u8`, `ContainsLifetime`) or anonymous: (e.g. `&'_ u8`, `ContainsLifetime<'_>`). It will also want to know if the lifetime is related to a reference (`&u8`) or a path (`ContainsLifetime`).
6c05ee2
to
2a5c349
Compare
@bors r=@nnethercote rollup |
Looks good, thank you. |
…rce, r=nnethercote Extend HIR to track the source and syntax of a lifetime An upcoming lint will want to be able to know if a lifetime is hidden (e.g. `&u8`, `ContainsLifetime`) or anonymous: (e.g. `&'_ u8`, `ContainsLifetime<'_>`). It will also want to know if the lifetime is related to a reference (`&u8`) or a path (`ContainsLifetime`). r? `@nnethercote`
Rollup of 23 pull requests Successful merges: - rust-lang#139261 (mitigate MSVC alignment issue on x86-32) - rust-lang#139307 (std: Add performance warnings to HashMap::get_disjoint_mut) - rust-lang#139700 (Autodiff flags) - rust-lang#139752 (set subsections_via_symbols for ld64 helper sections) - rust-lang#139809 (Don't warn about `v128` in wasm ABI transition) - rust-lang#139852 (StableMIR: Implement `CompilerInterface`) - rust-lang#139945 (Extend HIR to track the source and syntax of a lifetime) - rust-lang#140028 (`deref_patterns`: support string and byte string literals in explicit `deref!("...")` patterns) - rust-lang#140139 (rustc_target: Adjust RISC-V feature implication) - rust-lang#140143 (Move `sys::pal::os::Env` into `sys::env`) - rust-lang#140148 (CI: use aws codebuild for job dist-arm-linux) - rust-lang#140150 (fix MAX_EXP and MIN_EXP docs) - rust-lang#140172 (Make algebraic functions into `const fn` items.) - rust-lang#140177 ([compiletest] Parallelize test discovery) - rust-lang#140181 (Remove `synstructure::Structure::underscore_const` calls.) - rust-lang#140184 (Update doc of cygwin target) - rust-lang#140186 (Rename `compute_x` methods) - rust-lang#140187 ([AIX] Handle AIX dynamic library extensions within c-link-to-rust-dylib run-make test) - rust-lang#140191 (Remove git repository from git config) - rust-lang#140194 (minicore: Have `//@ add-core-stubs` also imply `-Cforce-unwind-tables=yes`) - rust-lang#140195 (triagebot: label minicore changes w/ `A-test-infra-minicore` and ping jieyouxu on changes) - rust-lang#140202 (Make #![feature(let_chains)] bootstrap conditional in compiler/) - rust-lang#140214 (Remove comment about handling non-global where bounds with corresponding projection) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#134446 (Stabilize the `cell_update` feature) - rust-lang#139307 (std: Add performance warnings to HashMap::get_disjoint_mut) - rust-lang#139450 (Impl new API `std::os::unix::fs::mkfifo` under feature `unix_fifo`) - rust-lang#139809 (Don't warn about `v128` in wasm ABI transition) - rust-lang#139852 (StableMIR: Implement `CompilerInterface`) - rust-lang#139945 (Extend HIR to track the source and syntax of a lifetime) - rust-lang#140028 (`deref_patterns`: support string and byte string literals in explicit `deref!("...")` patterns) - rust-lang#140181 (Remove `synstructure::Structure::underscore_const` calls.) - rust-lang#140232 (Remove unnecessary clones) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#139945 - shepmaster:hir-lifetime-syntax-source, r=nnethercote Extend HIR to track the source and syntax of a lifetime An upcoming lint will want to be able to know if a lifetime is hidden (e.g. `&u8`, `ContainsLifetime`) or anonymous: (e.g. `&'_ u8`, `ContainsLifetime<'_>`). It will also want to know if the lifetime is related to a reference (`&u8`) or a path (`ContainsLifetime`). r? ``@nnethercote``
An upcoming lint will want to be able to know if a lifetime is hidden (e.g.
&u8
,ContainsLifetime
) or anonymous: (e.g.&'_ u8
,ContainsLifetime<'_>
). It will also want to know if the lifetime is related to a reference (&u8
) or a path (ContainsLifetime
).r? @nnethercote